#include "logindiaglog.h"
#include "mainwindow.h"
#include <QApplication>

#include <iostream>
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/imgproc.hpp"
using namespace std;
using namespace cv;

int gui_test(int argc, char *argv[])
{
    QApplication app(argc, argv);
    // LoginDiaglog w;
    // w.show();
    
    MainWindow *main = new MainWindow();
    main->setWindowTitle("欢迎界面");//设置窗体标题

    LoginDiaglog login;
    if (login.exec() == QDialog::Accepted)//调用login.exec()，阻塞主控制流，直到完成返回，继续执行主控制流
    {
        main->show();
        return app.exec();
    }
    else return 0;

    // return a.exec();
}


int opencv_test(int argc, char *argv[])
{
    Mat img;
    img = imread("lena.jpg",-1);
    imshow("a", img);
    waitKey(0);
    return 0;
}

int main(int argc, char *argv[])
{
#if 0
    gui_test(argc, argv);
#else
    opencv_test(argc, argv);
#endif
}
